<template>
  <el-dialog :visible.sync="visible" v-dialogDrag :title="title" :close-on-click-modal="false" class="tl-dialog" width="900px" @open="open" @close="close">
    <el-form class="tl-form" ref="form" :model="model" :rules="rules" label-width="150px" :disabled="disableEditSubmit">
      <el-row>
				<el-col :span="12">
					<el-form-item label="任务编码" prop="code" >
						<el-input v-model="model.code"></el-input>
					</el-form-item>
				</el-col>
			</el-row>
			<el-row>
				<el-col :span="12">
					<el-form-item label="任务名称" prop="name" >
						<el-input v-model="model.name"></el-input>
					</el-form-item>
				</el-col>
			<!-- </el-row>
      <el-row> -->
        <!-- <el-col :span="12">
          <el-form-item label="任务来源" prop="source" >
            <el-select v-model="model.source" filterable clearable>
              <el-option v-for="item in codeModel.taskSourceList" :key="item.code" :label="item.name" :value="parseInt(item.code)" />
            </el-select>
          </el-form-item>
        </el-col> -->
        <el-col :span="12">
          <el-form-item label="任务状态" prop="status" >
            <el-select v-model="model.status" filterable clearable>
              <el-option v-for="item in codeModel.taskStatusList" :key="item.code" :label="item.name" :value="parseInt(item.code)" />
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <!-- <el-col :span="12">
          <el-form-item label="任务效力" prop="effectiveness" >
            <el-select v-model="model.effectiveness" filterable clearable>
              <el-option v-for="item in codeModel.taskRunningStateList" :key="item.code" :label="item.name" :value="parseInt(item.code)" />
            </el-select>
          </el-form-item>
        </el-col> -->
        <!-- <el-col :span="12">
          <el-form-item label="任务类型" prop="type" >
            <el-select v-model="model.type" filterable clearable>
              <el-option v-for="item in codeModel.taskTypeList" :key="item.code" :label="item.name" :value="parseInt(item.code)" />
            </el-select>
          </el-form-item>
        </el-col> -->
      </el-row>
			<el-row>
				<el-col :span="24">
					<el-form-item label="任务描述" prop="introduction" >
						<el-input v-model="model.introduction" type="textarea" :rows="2"></el-input>
					</el-form-item>
				</el-col>
			</el-row>
			<el-row>
				<!-- <el-col :span="12">
					<el-form-item label="与同级任务的关系" prop="relation" >
            <el-select v-model="model.relation" filterable clearable>
              <el-option v-for="item in codeModel.taskRelationList" :key="item.code" :label="item.name" :value="parseInt(item.code)" />
            </el-select>
					</el-form-item>
				</el-col> -->
				<!-- <el-col :span="12">
					<el-form-item label="任务是否自动完成" prop="autocomplete" >
            <el-select v-model="model.autocomplete" filterable clearable>
              <el-option v-for="item in codeModel.autocompleteList" :key="item.code" :label="item.name" :value="parseInt(item.code)" />
            </el-select>
					</el-form-item>
				</el-col> -->
			</el-row>
			<el-row>
				<el-col :span="12">
					<el-form-item label="计划开始时间" prop="planbegintime" >
						<el-date-picker v-model="model.planbegintime" type="date" placeholder="计划开始时间" value-format="yyyy-MM-dd"></el-date-picker>
					</el-form-item>
				</el-col>
				<el-col :span="12">
					<el-form-item label="计划结束时间" prop="planendtime" >
						<el-date-picker v-model="model.planendtime" type="date" placeholder="计划结束时间" value-format="yyyy-MM-dd"></el-date-picker>
					</el-form-item>
				</el-col>
			</el-row>
			<el-row>
				<el-col :span="12">
					<el-form-item label="实际开始时间" prop="realbegintime" >
						<el-date-picker v-model="model.realbegintime" type="date" placeholder="实际开始时间" value-format="yyyy-MM-dd"></el-date-picker>
					</el-form-item>
				</el-col>
				<el-col :span="12">
					<el-form-item label="实际结束时间" prop="realendtime" >
						<el-date-picker v-model="model.realendtime" type="date" placeholder="实际结束时间" value-format="yyyy-MM-dd"></el-date-picker>
					</el-form-item>
				</el-col>
			</el-row>
			<el-row>
				<el-col :span="12">
					<el-form-item label="预估工时" prop="planhours" >
						<el-input-number v-model="model.planhours" :controls="false" :step="1" :min="0" style="width:100%"></el-input-number>
					</el-form-item>
				</el-col>
				<el-col :span="12">
					<el-form-item label="实际工时" prop="realhours" >
						<el-input-number v-model="model.realhours" :controls="false" :step="1" :min="0" style="width:100%"></el-input-number>
					</el-form-item>
				</el-col>
			</el-row>
			<el-row>
				<el-col :span="12">
					<el-form-item label="负责人工号" prop="responsibleusercode" >
						<el-input v-model="model.responsibleusercode" ></el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12">
					<el-form-item label="负责人姓名" prop="responsibleusername" >
						<el-input v-model="model.responsibleusername"></el-input>
					</el-form-item>
				</el-col>
			</el-row>
			<el-row>
				<el-col :span="12">
					<el-form-item label="任务下发状态" prop="deliverystatus" >
            <el-select v-model="model.deliverystatus" filterable clearable>
              <el-option v-for="item in codeModel.enabledList" :key="item.code" :label="item.name" :value="parseInt(item.code)" />
            </el-select>
					</el-form-item>
				</el-col>
				<el-col :span="12">
					<el-form-item label="最新任务进度(%)" prop="progress" >
						<el-input-number v-model="model.progress" :controls="false" :step="1" :min="0" style="width:100%"></el-input-number>
					</el-form-item>
				</el-col>
			</el-row>
      <!-- <div class="tl-form-line-title">
        其他信息
      </div> -->
			<el-row>
				<!-- <el-col :span="12">
					<el-form-item label="是否为派生任务" prop="derived" >
            <el-select v-model="model.derived" filterable clearable>
              <el-option v-for="item in codeModel.enabledList" :key="item.code" :label="item.name" :value="parseInt(item.code)" />
            </el-select>
					</el-form-item>
				</el-col> -->
				<!-- <el-col :span="12">
					<el-form-item label="关联的原始任务code" prop="origintaskcode" >
						<el-input v-model="model.origintaskcode"></el-input>
					</el-form-item>
				</el-col> -->
			</el-row>
			<el-row>
				<!-- <el-col :span="12">
					<el-form-item label="第几轮任务" prop="round" >
						<el-input-number v-model="model.round" :controls="false" :step="1" :min="0" style="width:100%"></el-input-number>
					</el-form-item>
				</el-col> -->
        <!-- <el-col :span="12">
					<el-form-item label="是否当前轮次任务" prop="currently" >
            <el-select v-model="model.currently" filterable clearable>
              <el-option v-for="item in codeModel.enabledList" :key="item.code" :label="item.name" :value="parseInt(item.code)" />
            </el-select>
					</el-form-item>
				</el-col> -->
				<!-- <el-col :span="12">
					<el-form-item label="关联流程ID" prop="flowid" >
						<el-input v-model="model.flowid"></el-input>
					</el-form-item>
				</el-col> -->
			</el-row>
			<el-row>
				<!-- <el-col :span="12">
					<el-form-item label="关联流程节点ID" prop="nodeid" >
						<el-input v-model="model.nodeid"></el-input>
					</el-form-item>
				</el-col> -->
				<!-- <el-col :span="12">
					<el-form-item label="关联流程节点实例ID" prop="nodeinsid" >
						<el-input v-model="model.nodeinsid"></el-input>
					</el-form-item>
				</el-col> -->
			</el-row>
			<el-row>
			</el-row>
			<el-row>
				<el-col :span="24">
					<el-form-item label="备注" prop="description" >
						<el-input v-model="model.description" type="textarea" :rows="2"></el-input>
					</el-form-item>
				</el-col>
			</el-row>
    </el-form>
    <div slot="footer" class="dialog-footer">
      <el-button :type="disableEditSubmit === false ? 'text' : 'primary'" @click="doCancelEdit">取消</el-button>
      <el-button type="primary" @click="doSubmitEdit" :loading="saveLoading" v-if="disableEditSubmit === false">确认</el-button>
    </div>
  </el-dialog>
</template>

<script>
/** mixins */
import { mixin_edit } from '@tapui/mixins/mixin_edit'
/** 子组件 */
/** 工具类 */
import { putAction, getAction, postAction, deleteAction } from '@tapui/utils/http'
/** VUE配置 */
export default {
  mixins: [mixin_edit],
  components: { },
  data() {
    return {
      moduleTitle: 'WBS任务',
      urlPrefix: '/cbb/pmTask/',
      url: {
        // 额外的url
        queryCodeList: '/cbb/pmTask/dataCodeList'
      }
    }
  },
  methods: {
    loaded() {
      // 页面加载完毕执行
    }
  }
}
</script>
<style lang="scss" scoped>
  .left-aligned-input .el-input-number__input input {
    text-align: left;
  }
</style>
